/*This file is part of Sandbox.

Sandbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.

Sandbox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Sandbox.  If not, see <http://www.gnu.org/licenses/>.

For contact, see the About page of my blog: <http://mygeekyware.wordpress.com/>.*/

#include <iostream>
#include "controlador.h"
#include "definiciones.h"
#include <SDL/SDL.h>
#include <SDL/SDL_events.h>
#include "particula.h"
#include <math.h>

using namespace std;

void controlador::Bomb(particula matriz[400][220], int x, int y) {
    int i,j;
    for (i=-1;i<2;i++) {
        for (j=-1;j<2;j++) {
            if (matriz[x+i][y+j].tipo == FIRE || (matriz[x+i][y+j].tipo == FUSE && matriz[x+i][y+j].contador > 0)) {
                ExplodeBomb(matriz,x,y);
            }
        }
    }
}